﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ERP_SaleQuery.aspx.cs" Inherits="CRM_Store_ERP_SaleQuery" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>销售业绩</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JavaScript/Common.js"></script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <form id="form1" runat="server">
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout" >
        <Content>
            <ext:Panel runat="server" Border="false" Layout="RowLayout">
                <TopBar>
                    <ext:Toolbar ID="Toolbar1" runat="server">
                        <Items>
                             <ext:Button runat="server" ID="extBtnLendCreate" Text="生成月借出单" Icon="BookAdd">
                                <DirectEvents>
                                    <Click OnEvent="OnBtnLendClick">
                                    </Click>
                                </DirectEvents>
                             </ext:Button>
                             <ext:Button runat="server" ID="extBtnSaleCreate" Text="生成月销售结算单" Icon="BookAdd">
                                 <DirectEvents>
                                    <Click OnEvent="OnBtnSaleClick">
                                    </Click>
                                </DirectEvents>
                             </ext:Button>
                             <ext:Button runat="server" ID="extBtnSalePayCreate" Text="生成销售汇总单" Icon="BookAdd">
                                 <DirectEvents>
                                    <Click OnEvent="OnBtnSalePayClick">
                                    </Click>
                                </DirectEvents>
                             </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:FormPanel ID="searchForm" runat="server" Border="false" Padding="5" Height="67">
                        <Content>
                            <ext:FieldSet runat="server" Title="查询条件" Border="true" Layout="ColumnLayout" Header="true" Height="54">
                                <Items>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:ComboBox runat="server" ID="extcomb_USER"  FieldLabel="销售人员"
                                                DisplayField="USER_NAME" ValueField="USER_ID" TabIndex="10" AnchorHorizontal="0.95"  >
                                                <Store>
                                                    <ext:Store runat="server" ID="Store_USER" AutoLoad="true">
                                                        <Reader>
                                                            <ext:JsonReader IDProperty="USER_ID">
                                                                <Fields>
                                                                    <ext:RecordField Name="USER_ID" />
                                                                    <ext:RecordField Name="USER_NAME" />
                                                                </Fields>
                                                            </ext:JsonReader>
                                                        </Reader>
                                                    </ext:Store>
                                                </Store>
                                            </ext:ComboBox>
                                        </Items>
                                    </ext:Container>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:CompositeField runat="server" FieldLabel="月份">
                                                <Items>
                                                    <ext:ComboBox runat="server" ID="extcomb_year" Editable="false" TabIndex="2" 
                                                    SelectOnFocus="true" AllowBlank="false" Width="80" >
                                                        <Items>
                                                            <ext:ListItem Text="2016" Value="2016" />
                                                            <ext:ListItem Text="2017" Value="2017" />
                                                            <ext:ListItem Text="2018" Value="2018" />
                                                            <ext:ListItem Text="2019" Value="2019" />
                                                            <ext:ListItem Text="2020" Value="2020" />
                                                        </Items>
                                                    </ext:ComboBox>
                                                    <ext:Label runat="server" Text="年"></ext:Label>
                                                    <ext:ComboBox runat="server" ID="extcomb_month" Editable="false" TabIndex="3" 
                                                    SelectOnFocus="true" AllowBlank="false" Width="80" >
                                                        <Items>
                                                            <ext:ListItem Text="01" Value="1" />
                                                            <ext:ListItem Text="02" Value="2" />
                                                            <ext:ListItem Text="03" Value="3" />
                                                            <ext:ListItem Text="04" Value="4" />
                                                            <ext:ListItem Text="05" Value="5" />
                                                            <ext:ListItem Text="06" Value="6" />
                                                            <ext:ListItem Text="07" Value="7" />
                                                            <ext:ListItem Text="08" Value="8" />
                                                            <ext:ListItem Text="09" Value="9" />
                                                            <ext:ListItem Text="10" Value="10" />
                                                            <ext:ListItem Text="11" Value="11" />
                                                            <ext:ListItem Text="12" Value="12" />
                                                        </Items>
                                                    </ext:ComboBox>
                                                    <ext:Label ID="Label1" runat="server" Text="月"></ext:Label>
                                                </Items>
                                            </ext:CompositeField>
                                        </Items>
                                    </ext:Container>
                                    <ext:Container runat="server" Layout="FormLayout" LabelAlign="Right" ColumnWidth="0.33">
                                        <Items>
                                            <ext:Panel ID="Panel2" runat="server" Height="25" AnchorHorizontal="0.95" Border="false" ButtonAlign="Right">
                                                <Content>
                                                    <table width="100%">
                                                        <tr style="width: 100%">
                                                            <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            </td>
                                                            <td align="right" width="50%">
                                                                <ext:Button ID="extBtn_Search" runat="server" Text="查询" Icon="Find">
                                                                    <Listeners>
                                                                        <Click Handler="gridPanel_listdata.reload();" />
                                                                    </Listeners>
                                                                </ext:Button>
                                                            </td>
                                                            <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;
                                                            </td>
                                                            <td align="left" width="50%">
                                                                <ext:Button ID="extBtn_Clear" runat="server" Text="清空" Icon="BasketDelete">
                                                                    <Listeners>
                                                                        <Click Handler="searchForm.reset();" />
                                                                    </Listeners>
                                                                </ext:Button>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </Content>
                                            </ext:Panel>
                                        </Items>
                                    </ext:Container>
                                </Items>
                            </ext:FieldSet>
                        </Content>
                    </ext:FormPanel>
                    <ext:GridPanel runat="server" ID="gridPanel_listdata" RowHeight="1" BodyStyle="border-width:1 0 0 0;" AutoScroll="true" TrackMouseOver="true" StripeRows="true">
                        <ColumnModel>
                            <Columns>
                                <ext:RowNumbererColumn Header="<center>序号</center>" Width="35" />
                                <ext:Column Header="<center>月份</center>" Width="150" DataIndex="DateM" />
                                <ext:Column Header="<center>销售人员</center>" Width="130" DataIndex="SalerName" />
                                <ext:Column Header="<center>上月剩余借出数量</center>" Width="100" DataIndex="lastCount" />
                                <ext:Column Header="<center>上月剩余借出金额</center>" Width="125" DataIndex="lastMonry"/>
                                <ext:Column Header="<center>本月借出数量</center>" Width="150" DataIndex="LendCount" />
                                <ext:Column Header="<center>本月借出金额</center>" Width="120" DataIndex="LendMoney" />
                                <ext:Column Header="<center>本月销售结算数量</center>" Width="125" DataIndex="SalePayCount"/>
                                <ext:Column Header="<center>本月销售结算金额</center>" Width="150" DataIndex="SalePayMoney" />                            
                            </Columns>
                        </ColumnModel>
                        <Store>
                            <ext:Store runat="server" ID="Store1" OnRefreshData="MyData_Refresh">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="Id" />
                                            <ext:RecordField Name="Saler" />
                                            <ext:RecordField Name="SalerName" />
                                            <ext:RecordField Name="DateM"  />
                                            <ext:RecordField Name="year"  />
                                            <ext:RecordField Name="month" />
                                            <ext:RecordField Name="lastCount" />
                                            <ext:RecordField Name="lastMonry" />
                                            <ext:RecordField Name="LendCount" />
                                            <ext:RecordField Name="LendMoney"/>
                                            <ext:RecordField Name="SalePayCount"/>
                                            <ext:RecordField Name="SalePayMoney"/>
                                            <ext:RecordField Name="InUser"/>
                                            <ext:RecordField Name="InDate" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <SelectionModel>
                            <ext:RowSelectionModel runat="server" SingleSelect="true" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar runat="server" ID="PagingToolbar1" PageSize="20" DisplayInfo="true"
                                Height="25" DisplayMsg="显示{0} - {1},共{2}条" EmptyMsg="没有可显示的记录" StateID="Store1" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
